package coins;

//~--- non-JDK imports --------------------------------------------------------

import com.dukascopy.api.INewsFilter;
import com.dukascopy.api.INewsFilter.NewsSource;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.LoadingProgressListener;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;
import com.dukascopy.api.system.Commissions;
import com.dukascopy.api.system.IStrategyExceptionHandler;
import com.dukascopy.api.system.ISystemListener;
import com.dukascopy.api.system.ITesterClient;
import com.dukascopy.api.system.JFAuthenticationException;
import com.dukascopy.api.system.JFVersionException;
import com.dukascopy.api.system.Overnights;

//~--- JDK imports ------------------------------------------------------------

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;

import java.util.Currency;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;

public class MyTesterClient implements ITesterClient {
    ITesterClient defaultTesterClient;

    public MyTesterClient() {
        try {
            defaultTesterClient = com.dukascopy.api.system.TesterFactory.getDefaultInstance();
        } catch (ClassNotFoundException e) {

            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {

            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InstantiationException e) {

            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    @Override
    public void connect(String jnlp, String username, String password)
            throws JFAuthenticationException, JFVersionException, Exception {

        // TODO Auto-generated method stub
        defaultTesterClient.connect(jnlp, username, password);
    }

    @Override
    public void reconnect() {

        // TODO Auto-generated method stub
        defaultTesterClient.reconnect();
    }

    @Override
    public boolean isConnected() {

        // TODO Auto-generated method stub
        return true;
    }

    @Override
    public long startStrategy(IStrategy strategy) throws IllegalStateException, NullPointerException {

        // TODO Auto-generated method stub
        return defaultTesterClient.startStrategy(strategy);
    }

    @Override
    public long startStrategy(IStrategy strategy, IStrategyExceptionHandler exceptionHandler)
            throws IllegalStateException, NullPointerException {

        // TODO Auto-generated method stub
        return defaultTesterClient.startStrategy(strategy, exceptionHandler);
    }

    @Override
    public IStrategy loadStrategy(File strategyBinaryFile) throws Exception {

        // TODO Auto-generated method stub
        return defaultTesterClient.loadStrategy(strategyBinaryFile);
    }

    @Override
    public void stopStrategy(long processId) {

        // TODO Auto-generated method stub
        defaultTesterClient.stopStrategy(processId);
    }

    @Override
    public Map<Long, IStrategy> getStartedStrategies() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getStartedStrategies();
    }

    @Override
    public void setSystemListener(ISystemListener systemListener) {

        // TODO Auto-generated method stub
        defaultTesterClient.setSystemListener(systemListener);
    }

    @Override
    public void addNewsFilter(INewsFilter newsFilter) {

        // TODO Auto-generated method stub
        defaultTesterClient.addNewsFilter(newsFilter);
    }

    @Override
    public INewsFilter getNewsFilter(NewsSource newsSource) {

        // TODO Auto-generated method stub
        return defaultTesterClient.getNewsFilter(newsSource);
    }

    @Override
    public INewsFilter removeNewsFilter(NewsSource newsSource) {

        // TODO Auto-generated method stub
        return defaultTesterClient.removeNewsFilter(newsSource);
    }

    @Override
    public void setSubscribedInstruments(Set<Instrument> instruments) {

        // TODO Auto-generated method stub
        defaultTesterClient.setSubscribedInstruments(instruments);
    }

    @Override
    public Set<Instrument> getSubscribedInstruments() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getSubscribedInstruments();
    }

    @Override
    public void setOut(PrintStream out) {

        // TODO Auto-generated method stub
        defaultTesterClient.setOut(out);
    }

    @Override
    public void setErr(PrintStream err) {

        // TODO Auto-generated method stub
        defaultTesterClient.setErr(err);
    }

    @Override
    public void setCacheDirectory(File cacheDirectory) {

        // TODO Auto-generated method stub
        defaultTesterClient.setCacheDirectory(cacheDirectory);
    }

    @Override
    public void setDataInterval(Period period, OfferSide side, InterpolationMethod interpolationMethod, long from,
                                long to) {

        // TODO Auto-generated method stub
        defaultTesterClient.setDataInterval(period, side, interpolationMethod, from, to);
    }

    @Override
    public Future<?> downloadData(LoadingProgressListener loadingProgressListener) {

        // TODO Auto-generated method stub
        return defaultTesterClient.downloadData(loadingProgressListener);
    }

    @Override
    public long startStrategy(IStrategy strategy, LoadingProgressListener testerProgressListener)
            throws IllegalStateException, NullPointerException {

        // TODO Auto-generated method stub
        return defaultTesterClient.startStrategy(strategy, testerProgressListener);
    }

    @Override
    public long startStrategy(IStrategy strategy, IStrategyExceptionHandler exceptionHandler,
                              LoadingProgressListener testerProgressListener)
            throws IllegalStateException, NullPointerException {

        // TODO Auto-generated method stub
        return defaultTesterClient.startStrategy(strategy, exceptionHandler, testerProgressListener);
    }

    @Override
    public void setGatherReportData(boolean gatherReportData) {

        // TODO Auto-generated method stub
        defaultTesterClient.setGatherReportData(gatherReportData);
    }

    @Override
    public boolean getGatherReportData() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getGatherReportData();
    }

    @Override
    public void setEventLogEnabled(boolean eventLogEnabled) {

        // TODO Auto-generated method stub
        defaultTesterClient.setEventLogEnabled(eventLogEnabled);
    }

    @Override
    public boolean getEventLogEnabled() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getEventLogEnabled();
    }

    @Override
    public void setProcessingStatsEnabled(boolean processingStats) {

        // TODO Auto-generated method stub
        defaultTesterClient.setProcessingStatsEnabled(processingStats);
    }

    @Override
    public boolean getProcessingStats() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getProcessingStats();
    }

    @Override
    public void createReport(File file) throws IOException, IllegalStateException {

        // TODO Auto-generated method stub
        defaultTesterClient.createReport(file);
    }

    @Override
    public void createReport(long processId, File file) throws IOException, IllegalStateException {

        // TODO Auto-generated method stub
        defaultTesterClient.createReport(processId, file);
    }

    @Override
    public void setInitialDeposit(Currency currency, double deposit) throws IllegalArgumentException {

        // TODO Auto-generated method stub
        defaultTesterClient.setInitialDeposit(currency, deposit);
    }

    @Override
    public double getInitialDeposit() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getInitialDeposit();
    }

    @Override
    public Currency getInitialDepositCurrency() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getInitialDepositCurrency();
    }

    @Override
    public void setLeverage(int leverage) {

        // TODO Auto-generated method stub
        defaultTesterClient.setLeverage(leverage);
    }

    @Override
    public int getLeverage() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getLeverage();
    }

    @Override
    public void setCommissions(Commissions commissions) {

        // TODO Auto-generated method stub
        defaultTesterClient.setCommissions(commissions);
    }

    @Override
    public Commissions getCommissions() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getCommissions();
    }

    @Override
    public void setOvernights(Overnights overnights) {

        // TODO Auto-generated method stub
        defaultTesterClient.setOvernights(overnights);
    }

    @Override
    public Overnights getOvernights() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getOvernights();
    }

    @Override
    public void setMarginCutLevel(int mcLevel) {

        // TODO Auto-generated method stub
        defaultTesterClient.setMarginCutLevel(mcLevel);
    }

    @Override
    public int getMarginCutLevel() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getMarginCutLevel();
    }

    @Override
    public void setMCEquity(double mcEquity) {

        // TODO Auto-generated method stub
        defaultTesterClient.setMCEquity(mcEquity);
    }

    @Override
    public double getMCEquity() {

        // TODO Auto-generated method stub
        return defaultTesterClient.getMCEquity();
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
